#ifndef GAMEIO_H
#define GAMEIO_H

#include <string>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include "MacroDef.h"

using namespace std;

class Manager;
class Timer;
class Scene;
class Background;

class GameIO
{
private:
	Manager* manager;
	Timer* timer;

	SDL_Surface* screen;
	
	void applySurface(int x, int y, SDL_Surface* source, SDL_Surface* dest, SDL_Rect* clip = NULL);
	void showBackground(Background** bg, SDL_Rect* camera);
	void showMap(intXY map, SDL_Rect* camera, SDL_Surface** mapImg);

public:
	GameIO();
	void getInput();
	void displayMainGame(Scene* scene);

	bool checkCollision(SDL_Rect* boxA, SDL_Rect* boxB);

	static SDL_Surface* loadImg(string filePath);
	static string conToStr(int n);
};

#endif